# 对list进行切片，从1开始，4结束，步长1
my_list = [0,1,2,3,4,5,6,7]
new_list = my_list[1:4:1]
print(f"结果：{new_list}")
# 对tuple进行切片，从头开始，到最后结束，步长1
my_tuple = (1,2,3,4,5,6)
new_tuple = my_tuple[:]
print(f"结果：{new_tuple}")
# 对str进行切片，从头开始，到最后结束，步长2
str = "hello world"
new_str = str[::2]
print(f"结果：{new_str}")
# 对str进行切片，从头开始，到最后结束，步长-1
new_str = str[::-1]
print(f"结果：{new_str}")
# 对list进行切片，从3开始，到1结束，步长-1
new_list = my_list[3:1:-1]
print(f"结果：{new_list}")
# 对元祖进行切片，从头开始，到最后结束，步长-2
new_tuple = my_tuple[::-2]
print(f"结果：{new_tuple}")

str1 = "万过薪月，员序程马黑来，nohtyP学"
new_str1 = str1[::-1][9:14]
print(f"结果：{new_str1}")